<?php
/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2018-07-04
 * Time: 18:05
 */
// 开发允许跨域访问
header('Access-Control-Allow-Origin:*');
class CustomerService extends MY_Controller
{
    // 客服分诊,图文,科室ids,病情id
    public function diagnosisText(){
        // if (empty($this->getUserByOpenid())) return;

        $deids = $this->input->post('deids');
        $co_id = $this->input->post('co_id');

        if (empty($deids) || empty($co_id)){
            $res['start'] = 300;
            $res['content'] = '请完整填写请求内容';
            echo json_encode($res,JSON_UNESCAPED_UNICODE);

            return;
        }

        foreach ($deids as $item) {
            $co_de['co_id'] = $co_id;
            $co_de['de_id'] = $item;
            $cds[] = $co_de;
        }
        $insertRes = $this->db->insert_batch('co_de',$cds);

        if ($insertRes > 0){
            $res['start'] = 200;
            $res['content'] = '客服分诊成功';
        }else {
            $res['start'] = 500;
            $res['content'] = '客服分诊失败';
        }
        echo json_encode($res,JSON_UNESCAPED_UNICODE);
    }

    // 客服分诊,电话,科室ids,病情id,医生id,对接时间,录音地址

    // 客服分诊,视频,科室ids,病情id,医生id,对接时间


}